Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

259
Visualizações
How can I bring Electron app to foreground every "N" minute?

I am trying to convert this EyeCare Chrome extension into an Electron app so that if you are not using the browser, this app can be installed on your machine and still reminds you to take care of your body and eyes every "N" minute.

The extension is able to open a new browser tab every "N" minute and the tab gets the focus.

I am trying to bring the Electron app to the foreground every "N" minute. I am storing the "N" value in a file and reading from it. N = User selected time (i.e. 10,20,30,40,50,60 min).

Is there a way I can make the Electron app foreground every "N" minute?

It would be great if the solution can be applied to all the platforms (Linux, Windows, and Mac).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Use win.focus(); to bring the window to the foreground.

To focus the window every "N" minutes use setInterval like this:

var minsNum = 20; // Minutes in between each focus.
setInterval(function ()
{
    win.focus();
}, minsNum * 60 * 1000); // setInterval uses milliseconds, so we're multiplying by 1000 to get it in seconds.
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda